<form action="/BoxSns/Home/Index/addTopic" id="addTopic" class="mgt10"  data-type="ajaxSubmit" method="post" >
	<volist name="params['form']"   id="vo">
		<input type="hidden" name="<{$key}>" value="<{$vo}>" />
	</volist>
	<input type="hidden" name="type" value="<{$params['type']}>" />
	<div class="form-item">
		<input type="text" placeholder="标题" class="topic_title" name="title">
	</div>
	<div class="form-item">
	<textarea style="width:100%" class="contentQuestion" name="content" data-type="kindeditor" placeholder="正文" ></textarea>	 
	</div>
	<div class="form-item">
		<div data-type="upload" upload="8"></div>
	</div>
   <div class="form-item-btn">
	<button type="button" class="btn colse btn-default btn-large a_bnt">取消</button>
	<button id="btnAsk" type="submit" class="btn  btn-success btn-large a_bnt">发布</button>
	</div>
</form>


<script type="text/html" id="addAnswerListItemHtml">
<div>
		 <a  href="/Group/topic/id/{{items.id}}" target="_blank">
            <li class="gclear media-topic-{{items.id}}">
                <div class="title-like" data-login="yes">
                    <span class="glyphicon glyphicon-thumbs-up"></span>
                    <span class="like-num"></br>{{items.hit_count}}</span>
                </div>
                <div class="title-content">
                    <p  class="title-link">{{items.title}}</p>
                  <!-- 图片 -->
                   
                    <div class="title-imgs">
                       {{each items['imgList'] as vo i}}
                         <img src="{{vo}}">
                        {{/each}}
                    </div>
                   
                    <!-- 图片 -->

                    <div class="title-info">
                        <span class="glyphicon glyphicon-user"></span>
                        {{items['user']['nickname']}} 
                        <span class="glyphicon glyphicon-time mgl20"></span>
                        <span class="comment-link" >最后回复 {{items['time_tran']}}</span>
                       
                    </div>
                </div>
                <div class="title-comment" ><span class="glyphicon glyphicon-comment"></span></br>  {{items.comment_count}}</div>

            </li>
</a>
</div>
</script>


<script type="text/javascript">
$(".topic_title").focus();
 	$("#addTopic").on("ajaxSubmitSuccess",function(e,content){
		 var data= JSON.parse(content);
		 if(data.error>0){
			 hiApp.alert(data.msg)
		}else{
			hiApp.alert("发布成功");
			 hiApp.hide_popup();
			  var answerList=$(".page").find(".topicList_<{$params['form']['pid']}>");
			  $(".contentQuestion").val("");
			  $(".topic_title").val("");
			  //$(".photoList-content").find("li").not(".add-image").remove();
			 // $("#contentQuestion").trigger("kindeditorChange");
			 box_render(data.msg,$("#addAnswerListItemHtml").html(),answerList,"prepend");
		}
		
	})
 </script>